import {defineStore} from 'pinia'


const useRouterStore = defineStore('router', {
    state: () => ({
        // 当前活动路由
        activeRouter: '',
        // 导航栏元素
        navRouter: []
    }),
    getters: {
        // 获取当前活动路由
        getActiveRouter: (state) => state.activeRouter,
        // 获取导航栏元素
        getNavRouter: (state) => state.navRouter
    },
    actions: {
        // 设置当前活动路由
        setActiveRouter(router: string) {
            this.activeRouter = router
        },
        // 设置导航栏元素
        setNavRouter(router: any) {
            this.navRouter = router
        }
    }

})


export default useRouterStore
